package com.relytosoft.mizar.media.alarm.services.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.relytosoft.mizar.media.alarm.api.entity.Alarm;
import com.relytosoft.mizar.media.alarm.api.pojo.dto.AlarmSaveDto;
import com.relytosoft.mizar.media.alarm.api.pojo.query.AlarmQuery;
import com.relytosoft.mizar.media.alarm.api.pojo.vo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author wss
 * @version 1.0
 * @date 2022/5/24 11:51
 */
public interface AlarmMapper extends BaseMapper<Alarm> {

    Page<AlarmListVo> selectPageAlarmList(@Param("page") Page<AlarmListVo> page, @Param("alarmQuery") AlarmQuery alarmQuery);

    List<TaskSelectVo> selectControlTaskList(@Param("dispositionType") Integer dispositionType);

    List<AlarmTypeVo> selectAlarmTypeList(@Param("alarmCategory") Integer alarmCategory);

    /**
     * 根据布控ID查询查询任务类型
     *
     * @param controlId 布控ID
     * @return 告警任务类型
     */
    AlarmTaskTypeVo selectTaskTypeByControlId(@Param("controlId") String controlId);

    /**
     * 根据ID查询告警详情
     */
    AlarmVo selectAlarmDetailById(@Param("id") Long id);


    void saveDetailByDto(@Param("alarmSaveDto") AlarmSaveDto alarmSaveDto);
}
